#include <bits/stdc++.h>
using namespace std;
priority_queue<int> q;
queue<int> p;
stack<int> b;
int t;
int n;
int a[200005];
vector<int> v;
int main()
{
    freopen("color","r",stdin);
    freopen("color","w",stdout);
    cin>>t;
    for(int i=1;i<=t;i++)
    {
        cin>>n;
        int sum=0;
        for(int j=1;j<=n;j++)
        {
            cin>>a[j];
            sum+=a[j];
        }
        cout<<sum<<endl;
    }
    //reverse(s.begin(),s.end());
    fclose(stdin);
    fclose(stdout);
    return 0;
}
